package org.sws.domain.activity.service.quota.rule.factory;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import org.sws.domain.activity.service.quota.rule.IActivityChain;

import java.util.Map;

/**
 * @Author sws
 * @Date 2025/3/19 09:20
 * @description:
 */
@Component
@RequiredArgsConstructor
public class ActivityChainFactory {

    private final Map<String, IActivityChain> activityChainMap;

    public IActivityChain createActivityChain() {
        IActivityChain activityChain = activityChainMap.get(ActionModel.activity_base_action.getCode());
        activityChain.appendNext(activityChainMap.get(ActionModel.activity_sku_stock_action.getCode()));
        return activityChain;
    }

    @Getter
    @AllArgsConstructor
    public enum ActionModel {

        activity_base_action("activity_base_action", "活动的库存、时间校验"),
        activity_sku_stock_action("activity_sku_stock_action", "活动sku库存"),
        ;

        private final String code;
        private final String info;

    }
}
